import com.alibaba.fastjson.JSONObject;

import java.io.IOException;
import java.net.Socket;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;

public class Reducer {
    public static void main(String[] args) {
        try {
            HashMap<String, Integer> result;
            Receiver receiver = Receiver.getInstance();
            receiver.connect();
            String[] content = receiver.getContent();
            result = receiver.getMap(content);
            for (Map.Entry<String, Integer> entry : result.entrySet()) {
                System.out.println(entry.getKey() + " : " + entry.getValue());
            }
        } catch (IOException | ExecutionException | InterruptedException e) {
            e.printStackTrace();
        }

    }
}
